package com.jingdianjichi.oss.adapter;

import com.jingdianjichi.oss.entity.FileInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;


public interface StorageAdapter {

    /**
     * 创建桶
     */


     void createBucket(String bucket) throws Exception;

    /**
     * 上传文件
     */
     void uploadFile(MultipartFile inputStream, String bucket, String objectName) throws Exception;

    /**
     * 列出所有桶
     */
     List<String> getAllBucket() throws Exception;

    /**
     * 列出所有桶和文件
     */
     List<FileInfo> getAllFiles(String bucket) throws Exception;

    /**
     * 下载
     */
     InputStream download(String bucket, String objectName) throws Exception;

    /**
     * 删除桶
     */

     void deleteBuckets(String bucket) throws Exception;

    /**
     * 删除文件
     */
     void deleteFiles(String bucket, String objectName) throws Exception;


}


